import request from '@/utils/request'

export default {

  addClass(clazz) {
    return request({
      url: '/admin/class',
      method: 'post',
      data: clazz
    })
  },
  deleteClass(classid) {
    return request({
      url: '/admin/class/' + classid,
      method: 'delete'
    })
  },
  deleteClasses(allClassIds) {
    return request({
      url: '/admin/class/list',
      method: 'delete',
      data: allClassIds
    })
  },
  updateClass(clazz) {
    return request({
      url: '/admin/class',
      method: 'put',
      data: clazz
    })
  },
  queryClass(classid) {
    return request({
      url: '/admin/class/' + classid,
      method: 'get'
    })
  },
  queryClasses(classQuery) {
    return request({
      url: '/admin/class/list',
      method: 'post',
      data: classQuery
    })
  },
  queryAllClasses(queryClasses) {
    return request({
      url: '/admin/class/list',
      method: 'post',
      data: queryClasses
    })
  },
  queryClassStudents(classid) {
    return request({
      url: '/admin/class/students/' + classid,
      method: 'get'
    })
  }
}
